"""
继承的基础语法： 1.单继承 2.多继承
"""


# 单继承

class Phone:
    IMEI = None  # 序列号
    producer = "DJ"  # 厂商

    def call_by_4g(self):
        print("4g通话")


class Phone2023(Phone):
    face_id = "10001"  # 面部识别

    def call_by_5g(self):
        print("2023新功能:5g")


phone2023 = Phone2023()

print(phone2023.producer)
phone2023.call_by_4g()
phone2023.call_by_5g()


# 多继承
class NFCReader:
    NFC_type = "第三代"  # 类型
    producer = "NFC-DJ"  # 厂商

    def read_card(self):
        print("读卡功能")

    def write_card(self):
        print("写卡功能")


class RemoteControl:
    rc_type = "红外遥控"

    def control(self):
        print("红外遥控开启了")


# 多继承的优先级排序是从左到右，先到先得
class MyPhone(Phone, NFCReader, RemoteControl):
    # 什么属性或方法都不再添加，格式上使用pass关键字
    pass


my_phone = MyPhone()
print("--------------------------------")
print(my_phone.producer)
my_phone.call_by_4g()
my_phone.read_card()
my_phone.write_card()
my_phone.control()
